package cn.ren.hai.base.service.impl;

import cn.ren.hai.base.mapper.ModuleMapper;
import cn.ren.hai.base.entity.Module;
import cn.ren.hai.base.service.ModuleService;
import cn.ren.hai.core.entity.QueryPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import cn.ren.hai.core.entity.PageInfo;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 导航  服务实现类
 * </p>
 *
 * @author wangdao
 * @since 2021-06-09
 */
@Service
public class ModuleServiceImpl extends ServiceImpl<ModuleMapper, Module> implements ModuleService {

    private final ModuleMapper moduleMapper;


    public ModuleServiceImpl(ModuleMapper moduleMapper) {
        this.moduleMapper = moduleMapper;
    }

    @Override
    public PageInfo<Module> list(QueryPage<Module> page) {
        QueryWrapper<Module> queryWrapper = new QueryWrapper<>();
        page.startPage();
        return new PageInfo<>(moduleMapper.selectList(queryWrapper));
    }
}
